from django import template

from hcw_models.models import *

register = template.Library()  


@register.simple_tag
def get_img(a):
    print ("==",a)
    img=MyUser.objects.get(username=a).img
    imgs="/uploads/"+str(img)
    return  imgs

@register.simple_tag

def get_com(id):
    a=Article.objects.get(id=id).ArticleCommentKey.all().count()
    return a